#include "error_process.h"
#include <QMessageBox>
#include <QDebug>

ErrorMessage::ErrorMessage(QObject *parent) : QObject(parent)
{
}

void ErrorMessage::showError(QWidget *parent, const QString &message)
{
    lastError = message;
    QMessageBox::critical(parent, "错误", message);
    qDebug() << "Error:" << message;
}

void ErrorMessage::showWarning(QWidget *parent, const QString &message)
{
    QMessageBox::warning(parent, "警告", message);
    qDebug() << "Warning:" << message;
}

void ErrorMessage::showInfo(QWidget *parent, const QString &message)
{
    QMessageBox::information(parent, "信息", message);
    qDebug() << "Info:" << message;
}
